<template>
	<view>
		<view class="my-settle">
			<label class="radio" @click="changeAllState">
				<radio :checked='isFulCheck' color="#c00000" /><text>全选</text>
			</label>
			<view class="my-settle-money">
				合计:<text class="money">￥{{changeStateMoney}}</text>
			</view>
			<view class="btn-close">总结（{{checkedCount}}）</view>
		</view>
	</view>
	
</template>

<script>
	import {mapGetters,mapMutations} from "vuex"
	export default {
		name:"my-settle",
		data() {
			return {
				
			};
		},
		computed:{
			...mapGetters('cart_m',['checkedCount','total','changeStateMoney']),
			isFulCheck(){
				return this.total == this.checkedCount
			}
		},
		methods:{
			...mapMutations('cart_m',['updateAllGoodsState']),
			changeAllState(){
				this.updateAllGoodsState(!this.isFulCheck)
			}
		}
		
	}
</script>

<style lang="scss">
.my-settle{
	width: 100%;
	height: 100rpx;
	background-color: white;
	border-top: 1px solid #ccc;
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: fixed;
	bottom: 0;
	left: 0;
	padding:0 20rpx;
	font-size: 30rpx;
	z-index: 10;
	.radio{
		display: flex;
		align-items: center;
	}
	.my-settle-money{
		text{
			color:#c00000;
		}
	}
	.btn-close{
		line-height: 100rpx;
		width:200rpx;
		background-color: #c00000;
		color: white;
		text-align: center;
	}
}
</style>